/* model */
import { BaseSelectUserVuexPropertyEnum } from '@src/component/common/BaseSelectUser/store'
import { BaseSelectUserPropsOptions } from '@src/component/common/BaseSelectUser/model'
/* store */
import { useBaseSelectUserStore } from '@src/component/common/BaseSelectUser/store/hooks/base'
/* vue */
import { computed } from 'vue'

function useBaseSelectUserStoreOptions() {
  
  const store = useBaseSelectUserStore()
  
  const options = computed(() => store.state.options)
  
  const setOptions = (value: BaseSelectUserPropsOptions) => {
    store.commit(BaseSelectUserVuexPropertyEnum.SetOptions, value)
  }
  
  return {
    options,
    setOptions
  }
}

function useBaseSelectCustomOptions() {
  
  const store = useBaseSelectUserStore()
  
  const CustomOptions = computed(() => store.state.CustomOptions)
  
  const setOptions = (value: BaseSelectUserPropsOptions) => {
    store.commit(BaseSelectUserVuexPropertyEnum.SetSearchCustomOptions, value)
  }
  
  return {
    CustomOptions,
    setOptions
  }
}

export {
  useBaseSelectUserStoreOptions,
  useBaseSelectCustomOptions
}
